#include "../include/head.h"

f_data data[] = {
    {1, "Boeing 737", "北京", {8, 0}, "上海", {12, 0}, "4小时", 500, 200, 150, 'y'},
    {2, "Airbus A320", "广州", {9, 30}, "深圳", {11, 30}, "2小时", 600, 180, 170, 'y'},
    {3, "Boeing 747", "成都", {14, 0}, "重庆", {18, 0}, "4小时", 700, 250, 200, 'n'}};
user_t user[] = {
    {"Bob", "123", 0, 1000},
    {"Alice", "456", 0, 2000},
    {"Tom", "789", 0, 3000},
    {"Jerry", "012", 0, 4000},
    {"star", "321", 0, 5000},
    {"cat", "654", 0, 6000},
};
void test1()
{
    f_data data1 = {0};
    // 1.初始化链表
    f_list *list = init_double_link_list();
    // 2.插入节点
    insert_double_node(list, data[0], 1);
    insert_double_node(list, data[2], 2);
    insert_double_node(list, data[1], 3);
    // 3.打印链表
    print_forward_double_link_list(list);
    // 4.删除节点
    data1 = delete_double_node(list, 2);
    printf("删除的航班班次为：%d\n", data1.id);
    // 5.打印链表
    print_forward_double_link_list(list);
    write_flight_file(list);
    // 6.销毁链表
    free_double_link_list(&list);
}
void test2()
{
    u_list *user_list = init_user_list();
    // u_node *new_node = create_node(user[0]);
    for (int i = 0; i < 6; i++)
    {
        insert_node(user_list, user[i], i + 1);
    }
    print_user_list(user_list);
    printf("===============删除=================\n");
    delete_user(user_list, 6);
    print_user_list(user_list);
    register_user(user_list);
    login_user(user_list);
    modify_user_value(user_list);
    // printf("===============查找=================\n");
    // search_user_IDcard(user_list);
    // printf("===============修改=================\n");
    // modify_user_name(user_list);
    save_user_list(user_list);
    // modify_user_passwd(user_list);
    // modify_user_value(user_list);
    // print_user_list(user_list);
    free_user_list(&user_list);
}
int main(int argc, char const *argv[])
{
    //test2();
    
    return 0;
}
